package com.example.usercenter.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.example.usercenter.model.domain.User;
import com.example.usercenter.model.domain.request.UserRegisterRequest;

import javax.servlet.http.HttpServletRequest;

/**
 * @author 张宇航
 * @description 针对表【user】的数据库操作Service
 * @createDate 2023-09-11 09:58:53
 */
public interface UserService extends IService<User> {


    /**
     * 用户注册
     * @return 新用户id
     */
    long userRegister(UserRegisterRequest userRegisterRequest);


    /**
     * @param userAccount  用户账户
     * @param userPassword 用户密码
     * @return 脱敏后的用户信息
     */
    User userLogin(String userAccount, String userPassword, HttpServletRequest request);

    // 返回用户脱敏
    User getSafetyUser(User originUser);


    // 用户注销
    int userLogout(HttpServletRequest request);
}
